<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <title>人车人</title>
    <link rel="icon" href="/assets/img/titleico.ico" type="image/x-icon">
    <link rel="stylesheet" href="/assets/css/common.css">
    <link rel="stylesheet" href="/assets/css/productDetail.css">
</head>
<body>
<header>
    <div id="goBack">
        <i class="inlineBlockImg"></i>
    </div>
    <p class="bannerTitle">产品详情</p>
</header>
<section>
    <div id="productHeader">
        <div id="productHeader_title">
            <div id="logo">
            	<img src='/assets/img/mingyunzhuling-chanpingxiangqin-xiangqingye@2x.png'>
            </div>
            <div id="logo_text">
                <p class="product_title">明云车抵融 <span class="product_tip">【明云租赁】</span></p>
                <p class="product_tip">成功申请人数达： <span class="product_tipNum">59624人</span></p>
            </div>
        </div>
        <ul id="qs_btn">
            <!-- <li class="active">
                6期借款
            </li>
            <li>
                6期借款
            </li> -->
        </ul>
        <ul id="qs_data">
            <li>
                <p class="qs_dataTitle">借款周期：</p>
                <p class="qs_dataMain_nomal">6个月周期</p>
            </li>
            <li>
                <p class="qs_dataTitle">借款金额：</p>
                <p class="qs_dataMain_speacil">5-20万</p>
            </li>
            <li>
                <p class="qs_dataTitle">参考利率：</p>
                <p class="qs_dataMain_nomal">1.3%利息</p>
            </li>
            <li>
                <p class="qs_dataTitle">手续费用：</p>
                <p class="qs_dataMain_nomal">0元</p>
            </li>
            <li>
                <p class="qs_dataTitle">借款方式：</p>
                <p class="qs_dataMain_nomal">先息后本</p>
            </li>
        </ul>
    </div>
    <div id="productAdvantage" class="modelBorder">
        <p class="modelTip">明云车抵融产品优势</p>
        <ul id='advantageList'>
            <li>
                <p class="advantage_tip">灵活性</p>
                <span class="advantage_text">移动端进件，搞笑快捷，最快可当天放款</span>
            </li>
        </ul>
    </div>
    <div id="productFlow" class="modelBorder">
        <p class="modelTip">贷款申请流程</p>
        <div id="productFlowBorder"></div>
        <ul>
            <li>
                <div class="blockImg flowLogo flowLogo1"></div>
                <p class="flowText">车辆预估</p>
            </li>
            <li>
                <div class="blockImg flowLogo flowLogo2"></div>
                <p class="flowText">提交初审</p>
            </li>
            <li>
                <div class="blockImg flowLogo flowLogo3"></div>
                <p class="flowText">风控审核</p>
            </li>
            <li>
                <div class="blockImg flowLogo flowLogo4"></div>
                <p class="flowText">签订合同</p>
            </li>
            <li>
                <div class="blockImg flowLogo flowLogo5"></div>
                <p class="flowText">抵押登记</p>
            </li>
            <li>
                <div class="blockImg flowLogo flowLogo6"></div>
                <p class="flowText">复核放款</p>
            </li>
        </ul>
    </div>
    <div id="productTerm" class="modelBorder">
        <p class="modelTip">贷款申请条件</p>
        <div class="Term_people">
            <ul>
                <li class="Term_main"><i></i>年龄20-60周岁</li>
                <li class="Term_main"><i></i>提供银行卡需开通网银</li>
                <li class="Term_main"><i></i>提供的手机号码需为银行卡预留号</li>
                <li class="Term_main"><i></i>有稳定工作和收入</li>
                <li class="Term_main"><i></i>无法院执行记录</li>
                <li class="Term_main"><i></i>当前无逾期、恶意逾期记录</li>
            </ul>
        </div>
        <div class="Term_people Term_car">
            <ul>
                <li class="Term_main"><i></i>车辆为申请人名下未查封全款车</li>
                <li class="Term_main"><i></i>7座及7座以下乘用车、SUV</li>
                <li class="Term_main"><i></i>新车上户需满2个月，过户需满1个月</li>
                <li class="Term_main"><i></i>二手车转手次数不超过4次，名下抵押不超过4次</li>
                <li class="Term_main"><i></i>车龄6年以内，里程数15万公里以内</li>
                <li class="Term_main"><i></i>车辆无大肇事、无水淹、无改装</li>
                <li class="Term_main"><i></i>车辆年检未过期，无严重违章</li>
            </ul>
        </div>
    </div>
    <div id="productData" class="modelBorder">
        <p class="modelTip">贷款申请所需资料</p>
        <ul id="data_list">
            <li>
                <div class="blockImg dataLogo dataLogo_sfz">
                	<img src='/assets/img/yinhangka-icon-xiangqingye@2x.png'>
                </div>
                <p>身份证</p>
            </li>
            <li>
                <div class="blockImg dataLogo"></div>
                <p>身份证</p>
            </li>
            <li>
                <div class="blockImg dataLogo"></div>
                <p>身份证</p>
            </li>
            <li>
                <div class="blockImg dataLogo"></div>
                <p>身份证</p>
            </li>
            <li>
                <div class="blockImg dataLogo"></div>
                <p>身份证</p>
            </li>
        </ul>
    </div>

</section>
<div id="applyBtn">
    <a id="Btn">快速申请</a>
</div>
<script src="/assets/js/jquery-3.1.1.min.js"></script>
<script>
	$(function(){
		var productID = window.sessionStorage['productID'];
		$.ajax({
			url:'/product/getProduct',
			type:'get',
			data:{
	    		productID:productID
	    	},
	    	success:function(data){
	    		console.log(data);
	    		var logoHTML = '';
	    		var logo_textHTML = '';
	    		var qs_btnHTML = '';
	    		var qs_dataHTML = '';
	    		var advantageListHTML = '';
	    		var data_listHTML = '';
	    		
	    		if(data.length>1){
	    			for(var i=0;i<data.length;i++){
	    				qs_btnHTML += `<li data_showID=${i}>${data[i].cycle}借款</li>`
		    		}
	    		}
	    			logoHTML = `<img src='${data[0].titleSrc}'>`
	    			logo_textHTML += `
	    			<p class="product_title">${data[0].product}车抵融 <span class="product_tip">【${data[0].product}租赁】</span></p>
	                <p class="product_tip">成功申请人数达： <span class="product_tipNum">59624人</span></p>
	    			`
	    			qs_dataHTML += `
	    			<li>
		                <p class="qs_dataTitle">借款周期：</p>
		                <p class="qs_dataMain_nomal">${data[0].cycle}</p>
		            </li>
		            <li>
		                <p class="qs_dataTitle">借款金额：</p>
		                <p class="qs_dataMain_speacil">${data[0].moneyMin}-${data[0].moneyMax}万</p>
		            </li>
		            <li>
		                <p class="qs_dataTitle">参考利率：</p>
		                <p class="qs_dataMain_nomal">${data[0].rate}利率</p>
		            </li>
		            <li>
		                <p class="qs_dataTitle">手续费用：</p>
		                <p class="qs_dataMain_nomal">${data[0].fee}费用</p>
		            </li>
		            <li>
		                <p class="qs_dataTitle">借款方式：</p>
		                <p class="qs_dataMain_nomal">${data[0].returnType}</p>
		            </li>
	    			`
	    			for(var j=0;j<data[0].content.length;j++){
	    				advantageListHTML += `
		    			<li>
			                <p class="advantage_tip">${data[0].content[j].point}</p>
			                <span class="advantage_text">${data[0].content[j].good}</span>
			            </li>
		    			`
	    			}
	    			
	    			for(var j=0;j<data[0].info.length;j++){
	    				data_listHTML += `
	    				<li>
		    				<div class="blockImg dataLogo"><img src='${data[0].info[j][1]}'></div>
		                    <p>${data[0].info[j][0]}</p>
		                </li>
	    				`
	    			}
	    			
	    		$('#qs_btn').html(qs_btnHTML);
	    		$('#logo').html(logoHTML);
	    		$('#logo_text').html(logo_textHTML);
	    		$('#qs_data').html(qs_dataHTML);
	    		$('#advantageList').html(advantageListHTML);
	    		$('#data_list').html(data_listHTML);
	    		$('productAdvantage>p').html(`${data[0].product}车抵融产品优势`);
	    		$('#qs_btn li:first-child').addClass('active');
	    		
	    		$('#qs_btn').on('click','li',function(){
	    			$(this).addClass('active').siblings('.active').removeClass('active');
	    			var showID = $(this).attr('data_showID');
	    			var qs_dataHTML = '';
	    			var advantageListHTML = '';
	    			var data_listHTML  = ''; 
	    			for(var i=0;i<data.length;i++){
	    				qs_dataHTML = `
		    			<li>
			                <p class="qs_dataTitle">借款周期：</p>
			                <p class="qs_dataMain_nomal">${data[showID].cycle}</p>
			            </li>
			            <li>
			                <p class="qs_dataTitle">借款金额：</p>
			                <p class="qs_dataMain_speacil">${data[showID].moneyMin}-${data[showID].moneyMax}万</p>
			            </li>
			            <li>
			                <p class="qs_dataTitle">参考利率：</p>
			                <p class="qs_dataMain_nomal">${data[showID].rate}利息</p>
			            </li>
			            <li>
			                <p class="qs_dataTitle">手续费用：</p>
			                <p class="qs_dataMain_nomal">${data[showID].fee}元</p>
			            </li>
			            <li>
			                <p class="qs_dataTitle">借款方式：</p>
			                <p class="qs_dataMain_nomal">${data[showID].returnType}</p>
			            </li>
		    			`
		    			var content = data[showID].content;
		    			var info = data[showID].info;
		    			
	    			}
	    			for(var j=0;j<content.length;j++){
	    				advantageListHTML += `
		    			<li>
			                <p class="advantage_tip">${content[j].point}</p>
			                <span class="advantage_text">${content[j].good}</span>
			            </li>
		    			`
	    			}
	    			
	    			console.log(info);
	    			for(var j=0;j<info.length;j++){
	    				console.log( info[j][1] );
	    				data_listHTML += `
	    				<li>
		                    <div class="blockImg dataLogo"><img src='${info[j][1]}'></div>
		                    <p>${info[j][0]}</p>
		                </li>
	    				`
	    			}
		    		$('#qs_data').html(qs_dataHTML);
		    		$('#advantageList').html(advantageListHTML);
		    		$('#data_list').html(data_listHTML);
	    		})
	    		
	    		
	    		
	    	}
		})
		
		$('#goBack').click(function(e){
			e.stopPropagation();
			window.location.href='/product'
		})
		
	})
</script>
</body>
</html>